    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>改变浏览器宽度改变颜色</title>
        <script src="jQuery1.0.0.1.js"></script>
    </head>
    <body>
    <script>
        //检测浏览器宽度与检测屏幕宽度所用函数不同
        // window.onresize = function () {
        //     document.title = client().width + "    "+ client().height;
        // }
        // window.onresize = function () {
        //     document.title = window.screen.width + "    "+ window.screen.height;
        // }
        window.onresize=col;
        col();
            function col () {
         if (client().width>960){
             document.body.style.background='#41cc19';
         }else if (client().width>650){
             document.body.style.background='#2b0ccc';
         }else{
             document.body.style.background='#cc141a';
         }
        }
    </script>

    </body>
    </html>